<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" charset="utf-8">
        //混合继承
        /**
         * @param name
         * @param age
         * @constructor
         */
        function Person(name,age) {
            this.name = name;
            this.age = age;
        }
        function Boy(name,age,sex) {
            //借用构造函数继承
            Person.call(this,name,age);
            this.sex = sex;
        }
        var b = new Boy('张三',20,'男');
        alert(b.name);
        alert(b.age);
        alert(b.sex);
    </script>
</head>
<body>
</body>
</html>